package com.icode.jersey;

import com.sun.jersey.api.container.grizzly2.GrizzlyServerFactory;
import com.sun.jersey.api.core.PackagesResourceConfig;
import com.sun.jersey.api.core.ResourceConfig;
import org.glassfish.grizzly.http.server.HttpServer;

import javax.ws.rs.core.UriBuilder;
import java.net.URI;

/**
 * Created with IntelliJ IDEA.
 * User: alexz
 * Date: 14-7-11
 * Time: 上午11:22
 * To change this template use File | Settings | File Templates.
 */
public class Publisher {

    public static void main(String[] args) throws Exception {
        URI uri = UriBuilder.fromUri("http://localhost/").port(8888).build();
        ResourceConfig config = new PackagesResourceConfig("com.icode.jersey.resource");
        HttpServer httpServer = GrizzlyServerFactory.createHttpServer(uri, config);

        System.in.read();

        httpServer.stop();
    }
}
